Micron Document
🎖️GitЯра🎖️


Displaying Rendered • View rawDownload

docs/en/developer/transport.md f17c38bf64dcd629641d1e310876871a2f8bfdac (f17c38bf) Text, 2.94 KB

title: Transport
parent: Developer Guide
nav_order: 5
last_updated: 2026-05-13
aliases:
• ble
• serial
• tcp
• radio-transport

Transport

Meshtastic communicates between the app and radio hardware through multiple transport mechanisms.

Transport Abstraction

The transport layer is abstracted through interfaces in T383838core/network and T383838core/ble, allowing the app to work identically regardless of the underlying connection type.

T282828
App ← RadioController → Transport (BLE | Serial | TCP)

Bluetooth Low Energy (BLE)

Module: T383838core:ble
Platforms: Android, Desktop (JVM via Kable), iOS (planned)

The primary transport for mobile devices and also available on desktop:
• Service discovery for Meshtastic GATT services
• Characteristic-based read/write for protobuf packets
• Connection state management and automatic reconnection
• MTU negotiation for optimal packet sizes

Key Classes

• T383838core/ble/ — BLE scanning, connection, and GATT operations
• Platform-specific implementations in T383838androidMain and T383838jvmMain (Kable)

USB Serial

Module: T383838core:network
Platforms: Android (OTG), Desktop

Serial communication over USB:
• Uses T383838usb-serial-for-android library on Android
• Direct serial port access on Desktop (JVM)
• Probe table for supported USB vendor/product IDs
• Automatic detection when USB device is connected

Key Classes

• Serial prober and transport factory in T383838core/network
• Desktop-specific serial in T383838desktopApp/src/main/kotlin/.../radio/

TCP/IP

Module: T383838core:network
Platforms: Android, Desktop, iOS

Network-based transport for WiFi-enabled radios:
• TCP socket connection to radio's IP address
• Default port: 4403
• Used for development with simulated radios
• Available when BLE/USB is impractical

Transport Factory

The T383838RadioTransportFactory interface abstracts transport creation:

T282828
Tff7b72interface T56d364RadioTransportFactory Tb4b4b4{
Tff7b72val Te6edf3supportedDeviceTypesTb4b4b4: Te6edf3ListTff7b72<Te6edf3DeviceTypeTff7b72>
Tff7b72fun Td2a8ffcreateTransportTb4b4b4(Te6edf3addressTb4b4b4: Tffa657StringTb4b4b4, Te6edf3serviceTb4b4b4: Te6edf3RadioInterfaceServiceTb4b4b4)Tb4b4b4: Te6edf3RadioTransport
Tff7b72fun Td2a8ffisMockTransportTb4b4b4(Tb4b4b4)Tb4b4b4: Tffa657Boolean
Tff7b72fun Td2a8ffisAddressValidTb4b4b4(Te6edf3addressTb4b4b4: Tffa657String?Tb4b4b4)Tb4b4b4: Tffa657Boolean
Tff7b72fun Td2a8fftoInterfaceAddressTb4b4b4(Te6edf3interfaceIdTb4b4b4: Te6edf3InterfaceIdTb4b4b4, Te6edf3restTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Tffa657String
Tb4b4b4}


Platform-specific implementations:
Android: Supports BLE + USB + TCP
Desktop: Supports BLE (Kable) + USB + TCP
iOS: Planned BLE + TCP

Connection Lifecycle

1. Discovery — Scan for available radios (BLE scan / USB detect / manual TCP)
2. Connection — Establish link to selected radio
3. Handshake — Exchange node info and configuration
4. Active — Normal message exchange
5. Disconnection — Clean teardown or error recovery

Adding a New Transport

1. Implement T383838RadioTransport interface
2. Register in platform-specific T383838RadioTransportFactory
3. Add connection UI in T383838feature:connections
4. Update DI bindings for the platform


Served by rngit 1.5.0 - Generated in 0.04s